var tableScrollable = {
    init : function(){

        //        $("table.table-scrollable,table.table-scrollable thead,table.table-scrollable tfoot").css({
//            "min-width":"5000px"
//        });


        var $table = $("table.table-scrollable");
        var $header = $("thead",$table);
        var $footer = $("tfoot",$table);

        $($footer).removeAttr("style");
        $($header).removeAttr("style");
        $("td,th",$table).removeAttr("style");

        $("td,th",$table).each(function(i,cell){
            $(cell).width($(cell).width());
        });

        $header.css({
            "position" : "fixed",
            "top" : "40px"
        });

        $("table.table-scrollable").css("margin-top",$header.height()+"px");

        $footer.css({
            "position" : "fixed",
            "bottom" : "40px"
        });

        $("table.table-scrollable").css("margin-bottom",$footer.height()+"px");

        $(window).scroll(function(){
            $("table.table-scrollable thead, table.table-scrollable tfoot").css("left","-"+$(window).scrollLeft()+"px");
        });
    }
};